package jiachunlei.mement;

import java.util.ArrayList;
import java.util.List;

/**
 * 对象负责从 Memento 中恢复对象的状态
 * @author 朝花不迟暮
 * @version 1.0
 * @date 2020/12/8 23:26
 */
public class CareTaker
{
    private List<Memento> mementoList = new ArrayList<>();

    public void add(Memento state)
    {
        mementoList.add(state);
    }

    public Memento get(int index)
    {
        return mementoList.get(index);
    }
}
